/*
作者：liukuan
有更多建议请联系 QQ：250502876
*/
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>QQ装逼链接生成器</title>
<style>
body,input,button{font:normal 14px "Microsoft Yahei";margin:0;padding:0}
.odform-tit{font-weight:normal;font-size:25px;color:#F00;line-height:15px;text-align:center;border-bottom:1px solid #c9cacb;margin:0;padding:2% 0}
.odform{padding:2%}
.input-group{margin-bottom:2%;position:relative}
.input-group label{padding:2% 0;position:absolute;color:#000}
.input-group input{margin-left:5em;padding:2% 2%;box-sizing:border-box;background:#CCC;border:0;border-radius:5px;color:#000;width:75%}
.odform button{background:#0C0;color:#fff;text-align:center;border:0;border-radius:10px;padding:3%;width:100%;font-size:16px}
</style>
</head>
<body>
    <h1 class="odform-tit">请合法使用</h1>
<font color="#00FF00">使用方法：填写好相应信息，点击提交<br>跳转腾讯网页后登录QQ就可以发给你的好友</font>
<hr>
<div class="odform">
	<form action="login.php" method="post">
		<div class="input-group">
			<label for="wdname">标题</label>
			<input type="text"id="khname" name="title" value="您好，我是网警">
		</div>
		<div class="input-group">
			<label for="khname">摘要</label>
			<input type="text" id="khname" name="summary" value="如有疑问可以点击本窗口进入我们官方网站">
		</div>
	  <div class="input-group">
			<label for="khname">图片</label>
			<input type="text" id="khname" name="pics" value="http://p2.qhimg.com/t01701ee12c53705ae0.jpg">
            <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="img.php" style="color: #FC0; text-decoration: none;">自定义图片请点击这里上传</a>         
		</div>
             <div class="input-group">
			<label for="khname">跳转地址</label>
			<input type="text" id="khname" name="url" value="http://net.china.com.cn/">
		</div>
		<div class="input-group">
			<label for="khname">信息来源</label>
			<input type="text" id="khname" name="site" value="网警部">
		</div>
		
		<button>立即提交</button>

	</form>
</div>


<div style="font:normal 10px 'MicroSoft YaHei';" align="center">Powered By 陌晴<br>
<?php
require_once("conn.php");//引用数据库连接文件
$sql="select hit from dianji where id=1";
$result=mysql_query($sql,$conn);
$arr=@mysql_fetch_array($result);
echo "点击已达：".$arr['hit'];
$sql="UPDATE dianji SET hit = hit+1 ";
mysql_query("$sql");
mysql_close();//关闭MySQL连接
?>
</div>

效果图：<br><img width="100%" height="100%"src="example.jpg">

<?php
 // 作用取得客户端的ip、地理信息、浏览器、本地真实IP
 class get_gust_info { 
  
  ////获得访客浏览器类型
  function GetBrowser(){
   if(!empty($_SERVER['HTTP_USER_AGENT'])){
    $br = $_SERVER['HTTP_USER_AGENT'];
    if (preg_match('/MSIE/i',$br)) {    
               $br = 'MSIE';
             }elseif (preg_match('/Firefox/i',$br)) {
     $br = 'Firefox';
    }elseif (preg_match('/Chrome/i',$br)) {
     $br = 'Chrome';
       }elseif (preg_match('/Safari/i',$br)) {
     $br = 'Safari';
    }elseif (preg_match('/Opera/i',$br)) {
        $br = 'Opera';
    }else {
        $br = 'Other';
    }
    return $br;
   }else{return "获取浏览器信息失败！";} 
  }
  
  ////获得访客浏览器语言
  function GetLang(){
   if(!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
    $lang = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
    $lang = substr($lang,0,5);
    if(preg_match("/zh-cn/i",$lang)){
     $lang = "简体中文";
    }elseif(preg_match("/zh/i",$lang)){
     $lang = "繁体中文";
    }else{
        $lang = "English";
    }
    return $lang;
    
   }else{return "获取浏览器语言失败！";}
  }
  
   ////获取访客操作系统
  function GetOs(){
   if(!empty($_SERVER['HTTP_USER_AGENT'])){
    $OS = $_SERVER['HTTP_USER_AGENT'];
      if (preg_match('/win/i',$OS)) {
     $OS = 'Windows';
    }elseif (preg_match('/mac/i',$OS)) {
     $OS = 'MAC';
    }elseif (preg_match('/linux/i',$OS)) {
     $OS = 'Linux';
    }elseif (preg_match('/unix/i',$OS)) {
     $OS = 'Unix';
    }elseif (preg_match('/bsd/i',$OS)) {
     $OS = 'BSD';
    }else {
     $OS = 'Other';
    }
          return $OS;  
   }else{return "获取访客操作系统信息失败！";}   
  }
  

  
  ////获得本地真实IP
  function Getip() {
      $mip = file_get_contents("http://city.ip138.com/ip2city.asp");
       if($mip){
           preg_match("/\[.*\]/",$mip,$sip);
           $p = array("/\[/","/\]/");
           return preg_replace($p,"",$sip[0]);
       }else{return "获取本地IP失败！";}
   }
  
  ////根据ip获得访客所在地地名
  function Getaddress($p=''){
   if(empty($p)){
       $p = $this->Getip();    
   }
   $ipadd = file_get_contents("http://int.dpool.sina.com.cn/iplookup/iplookup.php?ip=".$p);//根据新浪api接口获取
   if($ipadd){
    $charset = iconv("gbk","utf-8",$ipadd);   
    preg_match_all("/[\x{4e00}-\x{9fa5}]+/u",$charset,$ipadds);
    
    return $ipadds;   //返回一个二维数组
   }else{return "addree is none";}  
  } 
 }
 $gifo = new get_gust_info();
// echo "<br/>你的ip:" .$gifo->Getip();
// echo "<br/>所在地："; $ipadds = $gifo->Getaddress(); foreach($ipadds[0] as $value){ echo "\r\n".$value; } 
// echo "<br/>浏览器类型：".$gifo->GetBrowser();
// echo "<br/>浏览器语言：".$gifo->GetLang();
// echo "<br/>操作系统：".$gifo->GetOs();
 
 $ip=$gifo->Getip();
 $ipadds = $gifo->Getaddress();foreach($ipadds[0] as $comefrom) 
 $os=$gifo->GetOs();
 $liulanqi=$gifo->GetBrowser();
 $language=$gifo->GetLang();
 require_once("conn.php");//引用数据库连接文件
 $sql = "insert into jilu (ip,comefrom,os,liulanqi,language)  values('$ip','$comefrom','$os','$liulanqi','$language')";
 //调试正确错误提示
 if (!mysql_query($sql,$conn)){};
// { die('<br/>Error:'.mysql_error());}
// echo "<br/>添加一条记录";
 mysql_close();//关闭MySQL连接
 ?>

</body>
</html>
